package com.tech.platform.cms.admin.controller;

import com.tech.platform.cms.admin.service.LoginService;
import com.tech.platform.cms.authz.common.model.LoginUserModel;
import com.tech.platform.cms.common.model.CommonResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

@RestController
@RequestMapping(value = "/admin/token")
public class LoginController {

    @Autowired
    private LoginService loginService;

    @RequestMapping(value = "login")
    public CommonResult<LoginUserModel> getAdminToken(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse) throws Exception{
        return loginService.getHgtToken(httpServletRequest,httpServletResponse);
    }
}
